<?php

namespace App\Modules\Admin\Repositories\Transformers;

use App\Modules\Admin\Models\AdminUser;
use League\Fractal\TransformerAbstract;

class AdminUserTransformer extends TransformerAbstract
{
    public function transform(AdminUser $adminUser)
    {
        return [
            'admin_uid' => (string) $adminUser->admin_uid,
            'account' => $adminUser->account,
            'name' => $adminUser->name,
            'avatar' => $adminUser->avatar,
            'sex' => $adminUser->sex,
            'source_type' => $adminUser->source_type,
            'created_at' => $adminUser->created_at != null ? $adminUser->created_at->toDateTimeString() : null,
        ];
    }
}
